package com.woniu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.entity.Fireworks;
import com.woniu.entity.FireworksConfig;
import com.woniu.vo.FireworksConfigVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description:
 * @Author: woniu
 * @date: 2023/12/22 9:02
 */
@Mapper
public interface FireworksConfigMapper extends BaseMapper<FireworksConfig> {

    @Select("SELECT fc.id AS f_config_id,fc.`name` AS f_name FROM fireworks_config AS fc ORDER BY RAND() LIMIT #{num}")
    List<FireworksConfigVO> findRandomVO(@Param("num") Integer num);

}
